import request from '#/utils/requestAbort';

export async function querySequence(params) {
  return request('/clearing-settlement/provincialTradeClearingResult/querySequence', {
    method: 'POST',
    data: params,
  });
}
// 省份-交易中心-场站（数据权限）
export async function queryMarketList(menuCode) {
  return request(`/power/dataPower/common/${menuCode}/t_station`, {
    method: 'GET',
  });
}
export async function flexibleAggregation(params) {
  // 开发时本地服务取不到主项目的环境变量
  const env = CLIENT_ENV === 'dev' ? 'release' : CLIENT_ENV;
  const { startDate, endDate, stationList, tradeType, sequenceIdList, operators, order } = params;
  const param = JSON.stringify({ startDate, endDate, stationList, tradeType, sequenceIdList });
  return request('/generation-common/flexible-aggregation/flexibleAggregation', {
    method: 'POST',
    data: params,
  });
}

// 灵活聚合接口
export async function queryClearResultBySequence(params) {
  return request('/reanalyze/provincialTradeClearingResult/queryClearResultBySequence', {
    method: 'POST',
    data: params,
  });
}
